Modeling of sighting distance for bioluminescent point source

Maximum sighting distances for point-source bioluminescence were modeled based on eye size across species. Results are imported and plotted here.

#import modeling results
modeling <- data.frame(read.csv("../Data/modeling.csv", header=TRUE, na.strings=c("", "NA", " ", stringsAsFactors = FALSE)))
#reorder factor levels for figure legend (phylo order)
modeling$species <- factor(modeling$species, 
                                      levels = c("Deosergestes corniculum",
                                                 "Deosergestes henseni",
                                                 "Allosergestes pectinatus",
                                                 "Allosergestes sargassi",
                                                 "Sergestes atlanticus",
                                                 "Neosergestes edwardsii",
                                                 "Parasergestes vigilax",
                                                 "Parasergestes armatus",
                                                 "Eusergestes arcticus",
                                                 "Gardinerosergia splendens",
                                                 "Robustosergia regalis",
                                                 "Robustosergia robusta",
                                                 "Phorcosergia grandis",
                                                 "Sergia tenuiremis",
                                                 "Challengerosergia talismani",
                                                 "Challengerosergia hansjacobi"))

#make shape palette
shapes.sp <- c("Deosergestes corniculum" = 21,
              "Deosergestes henseni" = 22, 
              "Allosergestes pectinatus" = 23, 
              "Allosergestes sargassi" = 24,
              "Sergestes atlanticus" = 25, 
              "Neosergestes edwardsii"= 23,
              "Parasergestes vigilax" = 21, 
              "Parasergestes armatus" = 22,
              "Eusergestes arcticus" = 23, 
              "Gardinerosergia splendens" = 24, 
              "Robustosergia regalis" = 25, 
              "Robustosergia robusta" = 21, 
              "Phorcosergia grandis" = 22,
              "Sergia tenuiremis" = 23,
              "Challengerosergia talismani" = 24,
              "Challengerosergia hansjacobi" = 25)

#sergia/sergestes green purple pallette
cols.sp <- c(#Sergestes group
              "Deosergestes corniculum" = "#512E5F",
              "Deosergestes henseni" = "#633974",
              "Allosergestes pectinatus" = "#76448A",
              "Allosergestes sargassi" = "#884EA0",
              "Sergestes atlanticus" = "#9B59B6",
              "Neosergestes edwardsii" = "#AF7AC5",
              "Parasergestes vigilax" = "#C39BD3",
              "Parasergestes armatus" = "#D7BDE2",
              "Eusergestes arcticus" = "#EBDEF0",
             #Sergia group
              "Gardinerosergia splendens" = "#ABEBC6",
              "Robustosergia regalis" = "#A9DFBF",
              "Robustosergia robusta" = "#52BE80",
              "Phorcosergia grandis" = "#27AE60",
              "Sergia tenuiremis" = "#1E8449",
              "Challengerosergia talismani" = "#196F3D",
              "Challengerosergia hansjacobi" = "#145A32")

Absolute sighting distance

# OLS regression of absolute sighting distance v. body length
ols_abs <- lm(abs_sight_m ~ body_mm, data = modeling)

#model output
summary(ols_abs)
## 
## Call:
## lm(formula = abs_sight_m ~ body_mm, data = modeling)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.5269 -0.2235  0.0165  0.1402  0.4943 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 0.340994   0.235249   1.449    0.169    
## body_mm     0.052807   0.006043   8.739 4.82e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3168 on 14 degrees of freedom
## Multiple R-squared:  0.8451, Adjusted R-squared:  0.834 
## F-statistic: 76.37 on 1 and 14 DF,  p-value: 4.825e-07
#save coefficient estimates
cc_olsabs <- as.data.frame(coefficients(ols_abs))

# Make plot for absolute sighting distances
plot_model_abs <- ggplot(modeling, aes(x = body_mm, y = abs_sight_m, color =  species, shape = species, fill = species)) + 
  geom_point(size = 2, alpha = 1) + 
  scale_shape_manual(values = shapes.sp, name = "Species") + 
  scale_color_manual(values = cols.sp, name = "Species") +
  scale_fill_manual(values = cols.sp, name = "Species") +
  xlab("Body length (mm)") + 
  ylab("Sighting distance (m)") + 
  xlim(c(0,60)) +
  ylim(c(0,4)) +
  theme_bw() +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), legend.text = element_text(face = "italic")) +
   geom_abline(data = cc_olsabs, aes(intercept = cc_olsabs[1,1], slope = cc_olsabs[2,1]), linetype = "dashed")

# Interactive plot
ggplotly(plot_model_abs)

Sighting distance relative to body length

# OLS regression of relative sighting distance v. body length
ols_rel <- lm(rel_sight ~ body_mm, data = modeling)

#model output
summary(ols_rel)
## 
## Call:
## lm(formula = rel_sight ~ body_mm, data = modeling)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -14.8898  -4.4492   0.5978   5.9812  13.6333 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  74.4142     6.6957  11.114 2.49e-08 ***
## body_mm      -0.2971     0.1720  -1.728    0.106    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.016 on 14 degrees of freedom
## Multiple R-squared:  0.1757, Adjusted R-squared:  0.1169 
## F-statistic: 2.985 on 1 and 14 DF,  p-value: 0.106
#save coefficient estimates
cc_olsrel <- as.data.frame(coefficients(ols_rel))

# Make plot for relative sighting distances
plot_model_rel <- ggplot(modeling, aes(x = body_mm, y = rel_sight, color =  species, shape = species, fill = species)) + 
  geom_point(size = 2, alpha = 1) + 
  scale_shape_manual(values = shapes.sp, name = "Species") + 
  scale_color_manual(values = cols.sp, name = "Species") +
  scale_fill_manual(values = cols.sp, name = "Species") +
  xlab("Body length (mm)") + 
  ylab("Relative sighting distance") + 
  xlim(c(0,60)) +
  ylim(c(0,90)) +
  theme_bw() +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), legend.text = element_text(face = "italic")) +
   geom_abline(data = cc_olsrel, aes(intercept = cc_olsrel[1,1], slope = cc_olsrel[2,1]), linetype = "dashed")

# Interactive plot
ggplotly(plot_model_rel)
#name panels
fig.a <- plot_model_abs + theme(legend.position = "none") 
fig.b <- plot_model_rel + theme(legend.position = "none") 

#arrange plots in panels
plots <- plot_grid(fig.a, fig.b,
           align = 'vh', 
           axis = 'lb',
           labels = c("A", "B"), #panel labels for figure
           hjust = -1, #adjustment for panel labels
           nrow = 1) #number of rows in grids

# extract legend from Rana temporaria figure
leg <- get_legend(fig.a + theme(legend.position="right"))

#export figure
pdf("../Figures/Fig-6.pdf", width = 12, height = 4.5)
plot_grid(plots, leg, ncol = 2, rel_widths = c(1, .3))
dev.off()
## quartz_off_screen 
##                 2